package com.linewell.commom.controller;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.linewell.commom.model.CustJudge;
import com.linewell.commom.service.ICustJudgeService;
import com.linewell.system.pagemodel.ReturnInfo;

/**
 * 客户评价控制器类
 * @author 蔡鹭佳
 * 时间：2016/9/18
 */
@Controller
@RequestMapping("/manage/custJudge")
public class CustJudgeController {
		
		private static final Log log = LogFactory.getLog(CustJudgeController.class);
	
		@Autowired
		private ICustJudgeService custJudgeService;
	
		/**
		 * 跳转到评价页
		 */
		@RequestMapping(value="/index")
		public String index(Integer id,Map<String, Object> map){
			if( id != null){
				map.put("id", id);
				map.put("dataGrid", "/manage/custJudge/dataGrid");
				return "/WEB-INF/pages/common/vehicle_info/commodify_info_retrun.jsp";
			}
			return null;
		}
		
		/**
		 * 获取评价内容
		 */
		@ResponseBody
		@RequestMapping(value="/dataGrid")
		public ReturnInfo dataGrid(Integer id,ReturnInfo dg){
			List<CustJudge> lst = null;
			if(id != null){
				lst =custJudgeService.find(id);
			}
			dg.setObj(lst);
			return dg;
		}
		
		
		
}
